unit uMensagens;

interface

uses
  Winapi.Windows;

type
  TMensagens=class
    class procedure MsgAviso(const Msg: string);
    class procedure MsgErro(const Msg: string);
    class function MsgPergunta(const Msg: string): Boolean;
  end;

implementation

(* ------------------------------ TMensagens -------------------------------- *)

class procedure TMensagens.MsgAviso(const Msg: string);
begin
  MessageBoxW(0, PWideChar(Msg), 'Aviso', MB_OK + MB_ICONINFORMATION);
end;

class procedure TMensagens.MsgErro(const Msg: string);
begin
  MessageBoxW(0, PWideChar(Msg), 'Erro', MB_OK + MB_ICONSTOP);
end;

class function TMensagens.MsgPergunta(const Msg: string): Boolean;
begin
  Result:= MessageBoxW(0, PWideChar(Msg), 'Pergunta', MB_YESNO + MB_ICONQUESTION) = IDYES;
end;

end.

